package rocketmq.listener;


import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.ConsumeMode;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.springframework.stereotype.Component;
import rocketmq.base.BaseListener;
import rocketmq.domain.RocketMqMessage;


/**
 * @author mercury
 */
@Component
@Slf4j
@RocketMQMessageListener(
        consumerGroup = "${rocketmq.producer.group:mercuryGroup}",
        topic = "topic_mercury",
        consumeMode = ConsumeMode.ORDERLY)
public class RocketMqListener extends BaseListener {

    @Override
    public void onMessage(RocketMqMessage message) {
        super.receiveMessage(message);
    }

    @Override
    protected void execute(RocketMqMessage content) {
        log.info("content :{}", content);
        log.info("execute success");
    }

    @Override
    protected void failExecute(RocketMqMessage content) {
        log.info("execute failExecute");
    }


}
